<template>
  <div>
    <el-button ref='test' type="primary" @click="clickpre()">子组件</el-button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      sum: "100"
    }
  },

  methods: {

    clickpre () {
      this.$message({
        message: this.$parent.clickRef(),
        type: 'success',
      });

    },


    getTest () {
      return this.sum
    }
  },

  mounted () {
    console.log(this.$parent)
  },
}
</script>